package com.woniuxy.reservation.app.apiImpl;

import cn.hutool.core.bean.BeanUtil;
import com.woniuxy.cloud.mall95.log.Log;
import com.woniuxy.reservation.client.param.InsertTakeNumParam;
import com.woniuxy.reservation.client.takenumclient.TakeNumManageClient;
import com.woniuxy.reservation.service.TakeNumService;
import com.woniuxy.reservation.service.serviceparam.InsertTakeNumServiceParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

@RestController
public class TakeNumManageClientApiImpl implements TakeNumManageClient {
    @Autowired
    private TakeNumService takeNumService;
    @Override
    @Log("添加排队取号")
    public Result insertTakeNum(InsertTakeNumParam param) {
        InsertTakeNumServiceParam insertTakeNumServiceParam = BeanUtil.toBean(param, InsertTakeNumServiceParam.class);
        takeNumService.insertTakeNum(insertTakeNumServiceParam);
        return Result.success();
    }

    @Override
    @Log("根据ID修改排队号状态")
    public Result updateTakeNumState(Integer storeId,Integer id, String numState) {
        takeNumService.updateTakeNumState(storeId,id,numState);
        return Result.success();
    }
}
